package com.zzyy.study;

import jakarta.annotation.PostConstruct;
import jakarta.annotation.Resource;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

/**
 * @auther zzyy
 * @create 2024-04-14 9:42
 */
@SpringBootApplication
public class Main24414
{
    @Resource
    private ThreadPoolTaskExecutor threadPool;

    @PostConstruct
    public void getThreadPoolConfig()
    {
        System.out.println("*******threadPool getCorePoolSize: "+threadPool.getCorePoolSize());
        System.out.println("*******threadPool getMaxPoolSize: "+threadPool.getMaxPoolSize());
        System.out.println("*******threadPool getQueueCapacity: "+threadPool.getQueueCapacity());
        System.out.println("*******threadPool getKeepAliveSeconds: "+threadPool.getKeepAliveSeconds());
        System.out.println("*******threadPool availableProcessors: "+Runtime.getRuntime().availableProcessors());
    }

    public static void main(String[] args)
    {
        SpringApplication.run(Main24414.class,args);

    }
}